﻿using System;
using Volo.Abp.Domain.Entities.Auditing;

namespace FlyingEye.Users.Models
{
    public class UserModel : AuditedEntity<Guid>
    {
        public string UserName { get; set; }

        public string Password { get; set; }

        public UserPermissions Permission { get; set; }

#pragma warning disable CS8618 
        /// <summary>
        /// 由 automapper 自动调用。
        /// </summary>
        public UserModel()
#pragma warning restore CS8618 
        {
            CreationTime = DateTime.Now;
        }

        public UserModel(string userName, string password, UserPermissions userPermission) : base()
        {
            UserName = userName;
            Password = password;
            Permission = userPermission;
        }

        public UserModel(Guid cretorId, string userName, string password, UserPermissions userPermission) : base()
        {
            CreatorId = cretorId;
            LastModificationTime = DateTime.Now;
            LastModifierId = cretorId;
            UserName = userName;
            Password = password;
            Permission = userPermission;
        }
    }
}
